
#ifndef ICollection_h
#define ICollection_h

// CSharp includes.
#include <Typedef.h>
#include <Defines.h>
#include <CSharpPropertyMethods.h>

// Riccsson includes.
#include <System/Object.h>
#include <System/Collections/IEnumerable.h>
#include <System/Array.h>

namespace Riccsson
{
	namespace System
	{
		namespace Collections
		{
			// Summary:
			//     Defines methods to manipulate generic collections.
			//
			// Type parameters:
			//   T:
			//     The type of the elements in the collection.
			interface ICollection : public IEnumerable
			{
			public:
				using IEnumerable::begin;
				using IEnumerable::end;

				PROP3GET(ICollection, int, Count)
				PROP3GET(ICollection, bool, IsReadOnly)
				
				COPY_CONSTRUCTOR(ICollection)
				{
					PROP3GET_INIT_COPY(ICollection, int, Count);
					PROP3GET_INIT_COPY(ICollection, bool, IsReadOnly);
				}
				
				protected: ICollection()
					: PROP3GET_INIT(ICollection, Count)
					, PROP3GET_INIT(ICollection, IsReadOnly)
				{
				}

				// Summary:
				//     Gets the number of elements contained in the System.Collections.Generic.ICollection<T>.
				//
				// Returns:
				//     The number of elements contained in the System.Collections.Generic.ICollection<T>.
				//int Count { get; }
				public: virtual PROP3_GET(int, Count) = 0;

				//
				// Summary:
				//     Gets a value indicating whether the System.Collections.Generic.ICollection<T>
				//     is read-only.
				//
				// Returns:
				//     true if the System.Collections.Generic.ICollection<T> is read-only; otherwise,
				//     false.
				//bool IsReadOnly { get; }
				public: virtual PROP3_GET(bool, IsReadOnly) = 0;

				// Summary:
				//     Adds an item to the System.Collections.Generic.ICollection<T>.
				//
				// Parameters:
				//   item:
				//     The object to add to the System.Collections.Generic.ICollection<T>.
				//
				// Exceptions:
				//   System.NotSupportedException:
				//     The System.Collections.Generic.ICollection<T> is read-only.
				public: virtual void Add(object* item) = 0;

				//
				// Summary:
				//     Removes all items from the System.Collections.Generic.ICollection<T>.
				//
				// Exceptions:
				//   System.NotSupportedException:
				//     The System.Collections.Generic.ICollection<T> is read-only.
				public: virtual void Clear() = 0;

				//
				// Summary:
				//     Determines whether the System.Collections.Generic.ICollection<T> contains
				//     a specific value.
				//
				// Parameters:
				//   item:
				//     The object to locate in the System.Collections.Generic.ICollection<T>.
				//
				// Returns:
				//     true if item is found in the System.Collections.Generic.ICollection<T>; otherwise,
				//     false.
				public: virtual bool Contains(object* item) = 0;

				//
				// Summary:
				//     Copies the elements of the System.Collections.Generic.ICollection<T> to an
				//     System.Array, starting at a particular System.Array index.
				//
				// Parameters:
				//   array:
				//     The one-dimensional System.Array that is the destination of the elements
				//     copied from System.Collections.Generic.ICollection<T>. The System.Array must
				//     have zero-based indexing.
				//
				//   arrayIndex:
				//     The zero-based index in array at which copying begins.
				//
				// Exceptions:
				//   System.ArgumentNullException:
				//     array is null.
				//
				//   System.ArgumentOutOfRangeException:
				//     arrayIndex is less than 0.
				//
				//   System.ArgumentException:
				//     array is multidimensional.-or-The number of elements in the source System.Collections.Generic.ICollection<T>
				//     is greater than the available space from arrayIndex to the end of the destination
				//     array.-or-Type T cannot be cast automatically to the type of the destination
				//     array.
				public: virtual void CopyTo(Array<object>* array, int arrayIndex) = 0;

				//
				// Summary:
				//     Removes the first occurrence of a specific object from the System.Collections.Generic.ICollection<T>.
				//
				// Parameters:
				//   item:
				//     The object to remove from the System.Collections.Generic.ICollection<T>.
				//
				// Returns:
				//     true if item was successfully removed from the System.Collections.Generic.ICollection<T>;
				//     otherwise, false. This method also returns false if item is not found in
				//     the original System.Collections.Generic.ICollection<T>.
				//
				// Exceptions:
				//   System.NotSupportedException:
				//     The System.Collections.Generic.ICollection<T> is read-only.
				public: virtual bool Remove(object* item) = 0;
			};
		}
	}
}

#endif // ICOLLISION_H